﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace GXRTBTC.PublicClassLibrary.Field
{
    /// <summary>
    /// 数据解析结构
    /// </summary>
    public class SchemaDocument
    {
        /// <summary>
        /// 表ID
        /// </summary>
        public string id { get; set; }
        /// <summary>
        /// 解析规则名称
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 关联规则名称
        /// 当有值时，需要通过此值去关联配置
        /// </summary>
        public string rname { get; set; }
        /// <summary>
        /// 文件夹名称，只在导入时有用
        /// </summary>
        public string file_name { get; set; }

        /// <summary>
        /// 用于区分解析命令码或结构体
        /// </summary>
        public string msgType { get; set; }

        /// <summary>
        /// 用于区分解析多种命名对应一个XML
        /// </summary>
        public string xmlType { get; set; }
        /// <summary>
        /// 数据索引列，多个用短横杠（-）隔开
        /// </summary>
        public string prefixCols { get; set; } = "";

        /// <summary>
        /// 规则字典
        /// </summary>
        public Dictionary<int, SchemaDictionary> fieldDictionary { get; set; }
        /// <summary>
        /// 动态参数字典, 用于记录结构体数组动态变化的变量与其值
        /// </summary>
        public Dictionary<string, string> dynamicParaDictionary { get; set; }
    }
}
